/*
 * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */

/*
 * @(#)DBMetaClient4.java	1.17 02/01/12
 */

package jdbcts.dbMeta.dbMeta4;

import java.io.*;
import java.util.*;

import java.sql.*;
import javax.sql.*;

import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import com.sun.cts.util.*;
import com.sun.cts.porting.*;
import com.sun.cts.harness.*;

import java.rmi.RemoteException;

import javasoft.sqe.javatest.Status;
import jdbcts.SuperTest;
import jdbcts.common.DataSourceConnection;
import jdbcts.common.DriverManagerConnection;
import jdbcts.common.dbSchema;

import com.sun.cts.tests.jdbc.ee.common.*;

// Merant DataSource class
//import com.merant.sequelink.jdbcx.datasource.*;

/**
 * The DBMetaClient4 class tests methods of DatabaseMetaData interface using
 * Sun's J2EE Reference Implementation.
 * 
 * @author
 * @version 1.7, 06/16/99
 */

public class DBMetaClient4 extends SuperTest implements Serializable
{
    private static final String testName = "jdbc.ee.dbMeta.dbMeta4";

    // Naming specific member variables
    private CTSNamingContextInterface jc = null;

    // Harness requirements

    private transient static Connection conn = null;

    private transient static DatabaseMetaData dbmd = null;

    private DataSource ds1 = null;

    private static dbSchema dbSch = null;

    // private String dbName=null,dbUser=null,drManager=null;
    private static String drManager = null;

    // private String
    // sCatalogName=null,sSchemaName=null,sPtable=null,sFtable=null;

    /* Run test in standalone mode */
    // public static void main(String[] args)
    // {
    // DBMetaClient4 theTests = new DBMetaClient4();
    // Status s=theTests.run(args, System.out, System.err);
    // s.exit();
    // }
    /* Test setup: */
    /*
     * @class.setup_props: Driver, the Driver name; db1, the database name with
     * url; user1, the database user name; password1, the database password;
     * db2, the database name with url; user2, the database user name;
     * password2, the database password; DriverManager, flag for DriverManager;
     * ptable, the primary table; ftable, the foreign table; cofSize, the
     * initial size of the ptable; cofTypeSize, the initial size of the ftable;
     * binarySize, size of binary data type; varbinarySize, size of varbinary
     * data type; longvarbinarySize, size of longvarbinary data type;
     * 
     * @class.testArgs: -ap ctssql.stmt
     */
    @BeforeClass
    // public void setup(String[] args, Properties p) throws Exception
    public static void setup() throws Exception
    {
	try
	{
	    try
	    {
		// drManager = p.getProperty("DriverManager","");
		drManager = isDRManager;
		// dbName = p.getProperty("db1","");
		// dbUser = p.getProperty("user1","");
		// sPtable = p.getProperty("ptable","CTSTABLE1");
		// sFtable = p.getProperty("ftable","CTSTABLE2");
		// if (dbName.length() == 0)
		// throw new Exception("Invalid db1  Database Name");
		// if (dbUser.length() == 0)
		// throw new Exception("Invalid Login Id");
		// if (sPtable.length() == 0)
		// throw new Exception("Invalid Primary table");
		// if (sFtable.length() == 0)
		// throw new Exception("Invalid Foreign table");
		if (drManager.length() == 0)
		    throw new Exception("Invalid DriverManager Name");

		// int nLocdbname = dbName.indexOf('=');
		// sCatalogName = dbName.substring(nLocdbname +1);
		// sCatalogName = sCatalogName.trim();
		// sSchemaName = dbUser;
		//
		if (drManager.equals("yes"))
		{
		    logMsg("Using DriverManager");
		    DriverManagerConnection dmCon = new DriverManagerConnection();
		    // conn = dmCon.getConnection(p);
		    conn = dmCon.getConnection(null);
		}
		else
		{
		    logMsg("Using DataSource");
		    DataSourceConnection dsCon = new DataSourceConnection();
		    // conn = dsCon.getConnection(p);
		    conn = dsCon.getConnection(null);
		}
		dbSch = new dbSchema();
		// dbSch.createData(p,conn);
		dbmd = conn.getMetaData();
	    }
	    catch (SQLException ex)
	    {
		logErr("SQL Exception : " + ex.getMessage());
	    }
	}
	catch (Exception e)
	{
	    logErr("Setup Failed!");
	    TestUtil.printStackTrace(e);
	}
    }

    /*
     * @testName: testSupportsConvert23
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The supportsConvert(int
     * fromType, int toType) method must return a boolean value; true if the
     * database supports the scalar function CONVERT for conversions between the
     * JDBC types fromType and toType and false otherwise. (See JDK 1.2.2 API
     * documentation)
     * 
     * @test_Strategy: Get the DataBaseMetaData object from the Connection to
     * the DataBase and call the supportsConvert(STRUCT, VARCHAR) method on that
     * object. It should return a boolean value; either true or false.
     */
    @Test
    public void testSupportsConvert23() throws Exception
    {
	try
	{
	    // invoke on the supportsConvert
	    logMsg("Calling supportsConvert(STRUCT, VARCHAR) on DatabaseMetaData");
	    boolean retValue = dbmd
		    .supportsConvert(Types.STRUCT, Types.VARCHAR);
	    if (retValue)
	    {
		logMsg("supportsConvert(STRUCT VARCHAR) method is supported");
	    }
	    else
	    {
		logMsg("supportsConvert(STRUCT VARCHAR) method is not supported");
	    }
	}
	catch (SQLException sqle)
	{
	    logErr("SQL exception " + sqle.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected exception " + e.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", e);
	}
    }

    /*
     * @testName: testSupportsConvert24
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The supportsConvert(int
     * fromType, int toType) method must return a boolean value; true if the
     * database supports the scalar function CONVERT for conversions between the
     * JDBC types fromType and toType and false otherwise. (See JDK 1.2.2 API
     * documentation)
     * 
     * @test_Strategy: Get the DataBaseMetaData object from the Connection to
     * the DataBase and call the supportsConvert(TIME, VARCHAR) method on that
     * object. It should return a boolean value; either true or false.
     */
    @Test
    public void testSupportsConvert24() throws Exception
    {
	try
	{
	    // invoke on the supportsConvert
	    logMsg("Calling supportsConvert(TIME, VARCHAR) on DatabaseMetaData");
	    boolean retValue = dbmd.supportsConvert(Types.TIME, Types.VARCHAR);
	    if (retValue)
	    {
		logMsg("supportsConvert(TIME VARCHAR) method is supported");
	    }
	    else
	    {
		logMsg("supportsConvert(TIME VARCHAR) method is not supported");
	    }
	}
	catch (SQLException sqle)
	{
	    logErr("SQL exception " + sqle.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected exception " + e.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", e);
	}
    }

    /*
     * @testName: testSupportsConvert25
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The supportsConvert(int
     * fromType, int toType) method must return a boolean value; true if the
     * database supports the scalar function CONVERT for conversions between the
     * JDBC types fromType and toType and false otherwise. (See JDK 1.2.2 API
     * documentation)
     * 
     * @test_Strategy: Get the DataBaseMetaData object from the Connection to
     * the DataBase and call the supportsConvert(TIMESTAMP, VARCHAR) method on
     * that object. It should return a boolean value; either true or false.
     */
    @Test
    public void testSupportsConvert25() throws Exception
    {
	try
	{
	    // invoke on the supportsConvert
	    logMsg("Calling supportsConvert(TIMESTAMP, VARCHAR) on DatabaseMetaData");
	    boolean retValue = dbmd.supportsConvert(Types.TIMESTAMP,
		    Types.VARCHAR);
	    if (retValue)
	    {
		logMsg("supportsConvert(TIMESTAMP VARCHAR) method is supported");
	    }
	    else
	    {
		logMsg("supportsConvert(TIMESTAMP VARCHAR) method is not supported");
	    }
	}
	catch (SQLException sqle)
	{
	    logErr("SQL exception " + sqle.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected exception " + e.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", e);
	}
    }

    /*
     * @testName: testSupportsConvert26
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The supportsConvert(int
     * fromType, int toType) method must return a boolean value; true if the
     * database supports the scalar function CONVERT for conversions between the
     * JDBC types fromType and toType and false otherwise. (See JDK 1.2.2 API
     * documentation)
     * 
     * @test_Strategy: Get the DataBaseMetaData object from the Connection to
     * the DataBase and call the supportsConvert(TINYINT, VARCHAR) method on
     * that object. It should return a boolean value; either true or false.
     */
    @Test
    public void testSupportsConvert26() throws Exception
    {
	try
	{
	    // invoke on the supportsConvert
	    logMsg("Calling supportsConvert(TINYINT, VARCHAR) on DatabaseMetaData");
	    boolean retValue = dbmd.supportsConvert(Types.TINYINT,
		    Types.VARCHAR);
	    if (retValue)
	    {
		logMsg("supportsConvert(TINYINT VARCHAR) method is supported");
	    }
	    else
	    {
		logMsg("supportsConvert(TINYINT VARCHAR) method is not supported");
	    }
	}
	catch (SQLException sqle)
	{
	    logErr("SQL exception " + sqle.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected exception " + e.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", e);
	}
    }

    /*
     * @testName: testSupportsConvert27
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The supportsConvert(int
     * fromType, int toType) method must return a boolean value; true if the
     * database supports the scalar function CONVERT for conversions between the
     * JDBC types fromType and toType and false otherwise. (See JDK 1.2.2 API
     * documentation)
     * 
     * @test_Strategy: Get the DataBaseMetaData object from the Connection to
     * the DataBase and call the supportsConvert(VARBINARY, VARCHAR) method on
     * that object. It should return a boolean value; either true or false.
     */
    @Test
    public void testSupportsConvert27() throws Exception
    {
	try
	{
	    // invoke on the supportsConvert
	    logMsg("Calling supportsConvert(VARBINARY, VARCHAR) on DatabaseMetaData");
	    boolean retValue = dbmd.supportsConvert(Types.VARBINARY,
		    Types.VARCHAR);
	    if (retValue)
	    {
		logMsg("supportsConvert(VARBINARY VARCHAR) method is supported");
	    }
	    else
	    {
		logMsg("supportsConvert(VARBINARY VARCHAR) method is not supported");
	    }
	}
	catch (SQLException sqle)
	{
	    logErr("SQL exception " + sqle.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected exception " + e.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", e);
	}
    }

    /*
     * @testName: testSupportsConvert28
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The supportsConvert(int
     * fromType, int toType) method must return a boolean value; true if the
     * database supports the scalar function CONVERT for conversions between the
     * JDBC types fromType and toType and false otherwise. (See JDK 1.2.2 API
     * documentation)
     * 
     * @test_Strategy: Get the DataBaseMetaData object from the Connection to
     * the DataBase and call the supportsConvert(BIGINT, INTEGER) method on that
     * object. It should return a boolean value; either true or false.
     */
    @Test
    public void testSupportsConvert28() throws Exception
    {
	try
	{
	    // invoke on the supportsConvert
	    logMsg("Calling supportsConvert(BIGINT, INTEGER) on DatabaseMetaData");
	    boolean retValue = dbmd
		    .supportsConvert(Types.BIGINT, Types.INTEGER);
	    if (retValue)
	    {
		logMsg("supportsConvert(BIGINT, INTEGER) method is supported");
	    }
	    else
	    {
		logMsg("supportsConvert(BIGINT, INTEGER) method is not supported");
	    }
	}
	catch (SQLException sqle)
	{
	    logErr("SQL exception " + sqle.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected exception " + e.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", e);
	}
    }

    /*
     * @testName: testSupportsConvert29
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The supportsConvert(int
     * fromType, int toType) method must return a boolean value; true if the
     * database supports the scalar function CONVERT for conversions between the
     * JDBC types fromType and toType and false otherwise. (See JDK 1.2.2 API
     * documentation)
     * 
     * @test_Strategy: Get the DataBaseMetaData object from the Connection to
     * the DataBase and call the supportsConvert(BIT, INTEGER) method on that
     * object. It should return a boolean value; either true or false.
     */
    @Test
    public void testSupportsConvert29() throws Exception
    {
	try
	{
	    // invoke on the supportsConvert
	    logMsg("Calling supportsConvert(BIT, INTEGER) on DatabaseMetaData");
	    boolean retValue = dbmd.supportsConvert(Types.BIT, Types.INTEGER);
	    if (retValue)
	    {
		logMsg("supportsConvert(BIT, INTEGER) method is supported");
	    }
	    else
	    {
		logMsg("supportsConvert(BIT, INTEGER) method is not supported");
	    }
	}
	catch (SQLException sqle)
	{
	    logErr("SQL exception " + sqle.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected exception " + e.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", e);
	}
    }

    /*
     * @testName: testSupportsConvert30
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The supportsConvert(int
     * fromType, int toType) method must return a boolean value; true if the
     * database supports the scalar function CONVERT for conversions between the
     * JDBC types fromType and toType and false otherwise. (See JDK 1.2.2 API
     * documentation)
     * 
     * @test_Strategy: Get the DataBaseMetaData object from the Connection to
     * the DataBase and call the supportsConvert(DATE, INTEGER) method onn that
     * object. It should return a boolean value; either true or false.
     */
    @Test
    public void testSupportsConvert30() throws Exception
    {
	try
	{
	    // invoke on the supportsConvert
	    logMsg("Calling supportsConvert(DATE, INTEGER) on DatabaseMetaData");
	    boolean retValue = dbmd.supportsConvert(Types.DATE, Types.INTEGER);
	    if (retValue)
	    {
		logMsg("supportsConvert(DATE, INTEGER) method is supported");
	    }
	    else
	    {
		logMsg("supportsConvert(DATE, INTEGER) method is not supported");
	    }
	}
	catch (SQLException sqle)
	{
	    logErr("SQL exception " + sqle.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected exception " + e.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", e);
	}
    }

    /*
     * @testName: testSupportsConvert31
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The supportsConvert(int
     * fromType, int toType) method must return a boolean value; true if the
     * database supports the scalar function CONVERT for conversions between the
     * JDBC types fromType and toType and false otherwise. (See JDK 1.2.2 API
     * documentation)
     * 
     * @test_Strategy: Get the DataBaseMetaData object from the Connection to
     * the DataBase and call the supportsConvert(DECIMAL, INTEGER) method on
     * that object. It should return a boolean value; either true or false.
     */
    @Test
    public void testSupportsConvert31() throws Exception
    {
	try
	{
	    // invoke on the supportsConvert
	    logMsg("Calling supportsConvert(DECIMAL, INTEGER) on DatabaseMetaData");
	    boolean retValue = dbmd.supportsConvert(Types.DECIMAL,
		    Types.INTEGER);
	    if (retValue)
	    {
		logMsg("supportsConvert(DECIMAL, INTEGER) method is supported");
	    }
	    else
	    {
		logMsg("supportsConvert(DECIMAL, INTEGER) method is not supported");
	    }
	}
	catch (SQLException sqle)
	{
	    logErr("SQL exception " + sqle.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected exception " + e.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", e);
	}
    }

    /*
     * @testName: testSupportsConvert32
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The supportsConvert(int
     * fromType, int toType) method must return a boolean value; true if the
     * database supports the scalar function CONVERT for conversions between the
     * JDBC types fromType and toType and false otherwise. (See JDK 1.2.2 API
     * documentation)
     * 
     * @test_Strategy: Get the DataBaseMetaData object from the Connection to
     * the DataBase and call the supportsConvert(DOUBLE, INTEGER) method on that
     * object. It should return a boolean value; either true or false.
     */
    @Test
    public void testSupportsConvert32() throws Exception
    {
	try
	{
	    // invoke on the supportsConvert
	    logMsg("Calling supportsConvert(DOUBLE, INTEGER) on DatabaseMetaData");
	    boolean retValue = dbmd
		    .supportsConvert(Types.DOUBLE, Types.INTEGER);
	    if (retValue)
	    {
		logMsg("supportsConvert(DOUBLE, INTEGER) method is supported");
	    }
	    else
	    {
		logMsg("supportsConvert(DOUBLE, INTEGER) method is not supported");
	    }
	}
	catch (SQLException sqle)
	{
	    logErr("SQL exception " + sqle.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected exception " + e.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", e);
	}
    }

    /*
     * @testName: testSupportsConvert33
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The supportsConvert(int
     * fromType, int toType) method must return a boolean value; true if the
     * database supports the scalar function CONVERT for conversions between the
     * JDBC types fromType and toType and false otherwise. (See JDK 1.2.2 API
     * documentation)
     * 
     * @test_Strategy: Get the DataBaseMetaData object from the Connection to
     * the DataBase and call the supportsConvert(FLOAT, INTEGER) method on that
     * object. It should return a boolean value; either true or false.
     */
    @Test
    public void testSupportsConvert33() throws Exception
    {
	try
	{
	    // invoke on the supportsConvert
	    logMsg("Calling supportsConvert(FLOAT, INTEGER) on DatabaseMetaData");
	    boolean retValue = dbmd.supportsConvert(Types.FLOAT, Types.INTEGER);
	    if (retValue)
	    {
		logMsg("supportsConvert(FLOAT, INTEGER) method is supported");
	    }
	    else
	    {
		logMsg("supportsConvert(FLOAT, INTEGER) method is not supported");
	    }
	}
	catch (SQLException sqle)
	{
	    logErr("SQL exception " + sqle.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected exception " + e.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", e);
	}
    }

    /*
     * @testName: testSupportsConvert34
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The supportsConvert(int
     * fromType, int toType) method must return a boolean value; true if the
     * database supports the scalar function CONVERT for conversions between the
     * JDBC types fromType and toType and false otherwise. (See JDK 1.2.2 API
     * documentation)
     * 
     * @test_Strategy: Get the DataBaseMetaData object from the Connection to
     * the DataBase and call the supportsConvert(NUMERIC, INTEGER) method on
     * that object. It should return a boolean value; true or false.
     */
    @Test
    public void testSupportsConvert34() throws Exception
    {
	try
	{
	    // invoke on the supportsConvert
	    logMsg("Calling supportsConvert(NUMERIC, INTEGER) on DatabaseMetaData");
	    boolean retValue = dbmd.supportsConvert(Types.NUMERIC,
		    Types.INTEGER);
	    if (retValue)
	    {
		logMsg("supportsConvert(NUMERIC, INTEGER) method is supported");
	    }
	    else
	    {
		logMsg("supportsConvert(NUMERIC, INTEGER) method is not supported");
	    }
	}
	catch (SQLException sqle)
	{
	    logErr("SQL exception " + sqle.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected exception " + e.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", e);
	}
    }

    /*
     * @testName: testSupportsConvert35
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The supportsConvert(int
     * fromType, int toType) method must return a boolean value; true if the
     * database supports the scalar function CONVERT for conversions between the
     * JDBC types fromType and toType and false otherwise. (See JDK 1.2.2 API
     * documentation)
     * 
     * @test_Strategy: Get the DataBaseMetaData object from the Connection to
     * the DataBase and call the supportsConvert(REAL, INTEGER) method on that
     * object. It should return a boolean value; either true false.
     */
    @Test
    public void testSupportsConvert35() throws Exception
    {
	try
	{
	    // invoke on the supportsConvert
	    logMsg("Calling supportsConvert(REAL, INTEGER) on DatabaseMetaData");
	    boolean retValue = dbmd.supportsConvert(Types.REAL, Types.INTEGER);
	    if (retValue)
	    {
		logMsg("supportsConvert(REAL, INTEGER) method is supported");
	    }
	    else
	    {
		logMsg("supportsConvert(REAL, INTEGER) method is not supported");
	    }
	}
	catch (SQLException sqle)
	{
	    logErr("SQL exception " + sqle.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected exception " + e.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", e);
	}
    }

    /*
     * @testName: testSupportsConvert36
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The supportsConvert(int
     * fromType, int toType) method must return a boolean value; true if the
     * database supports the scalar function CONVERT for conversions between the
     * JDBC types fromType and toType and false otherwise. (See JDK 1.2.2 API
     * documentation)
     * 
     * @test_Strategy: Get the DataBaseMetaData object from the Connection to
     * the DataBase and call the supportsConvert(SMALLINT, INTEGER) method on
     * that object. It should return a boolean value; either true or false.
     */
    @Test
    public void testSupportsConvert36() throws Exception
    {
	try
	{
	    // invoke on the supportsConvert
	    boolean retValue = dbmd.supportsConvert(Types.SMALLINT,
		    Types.INTEGER);
	    logMsg("Calling supportsConvert(SMALLINT, INTEGER) on DatabaseMetaData");
	    if (retValue)
	    {
		logMsg("supportsConvert(SMALLINT, INTEGER) method is supported");
	    }
	    else
	    {
		logMsg("supportsConvert(SMALLINT, INTEGER) method is not supported");
	    }
	}
	catch (SQLException sqle)
	{
	    logErr("SQL exception " + sqle.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected exception " + e.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", e);
	}
    }

    /*
     * @testName: testSupportsConvert37
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The supportsConvert(int
     * fromType, int toType) method must return a boolean value; true if the
     * database supports the scalar function CONVERT for conversions between the
     * JDBC types fromType and toType and false otherwise. (See JDK 1.2.2 API
     * documentation)
     * 
     * @test_Strategy: Get the DataBaseMetaData object from the Connection to
     * the DataBase and call the supportsConvert(TINYINT, INTEGER) method on
     * that object. It should return a boolean value; either true or false.
     */
    @Test
    public void testSupportsConvert37() throws Exception
    {
	try
	{
	    // invoke on the supportsConvert
	    logMsg("Calling supportsConvert(TINYINT, INTEGER) on DatabaseMetaData");
	    boolean retValue = dbmd.supportsConvert(Types.TINYINT,
		    Types.INTEGER);
	    if (retValue)
	    {
		logMsg("supportsConvert(TINYINT, INTEGER) method is supported");
	    }
	    else
	    {
		logMsg("supportsConvert(TINYINT, INTEGER) method is not supported");
	    }
	}
	catch (SQLException sqle)
	{
	    logErr("SQL exception " + sqle.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected exception " + e.getMessage());
	    throw new Exception("Call to supportsConvert is Failed!", e);
	}
    }

    /*
     * @testName: testSupportsTableCorrelationNames
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The
     * supportsTableCorrelationNames() method must return a boolean value; true
     * if the database supports table correlation names and false otherwise. A
     * JDBC compliant driver always return true. (See JDK 1.2.2 API
     * documentation)
     * 
     * @test_Strategy: Get the DataBaseMetaData object from the Connection to
     * the DataBase and call the supportsTableCorrelationNames() method on that
     * object. It should return a boolean value; either true or false.
     */
    @Test
    public void testSupportsTableCorrelationNames() throws Exception
    {
	try
	{
	    // invoke on the supportsTableCorrelationNames
	    logMsg("Calling supportsTableCorrelationNames on DatabaseMetaData");
	    boolean retValue = dbmd.supportsTableCorrelationNames();
	    if (retValue)
	    {
		logMsg("supportsTableCorrelationNames method is supported");
	    }
	    else
	    {
		logMsg("supportsTableCorrelationNames method is not supported");
	    }
	}
	catch (SQLException sqle)
	{
	    logErr("SQL exception " + sqle.getMessage());
	    throw new Exception(
		    "Call to supportsTableCorrelationNames is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected exception " + e.getMessage());
	    throw new Exception(
		    "Call to supportsTableCorrelationNames is Failed!", e);
	}
    }

    /*
     * @testName: testSupportsDifferentTableCorrelationNames
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The
     * supportsDifferentTableCorrelationNames() method must return a boolean
     * value; true if the database supports table correlation names and false
     * otherwise. (See JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get the DataBaseMetaData object from the Connection to
     * the DataBase and call the supportsDifferentTableCorrelationNames() method
     * on that object. It should return a boolean value; either true or false.
     */
    @Test
    public void testSupportsDifferentTableCorrelationNames() throws Exception
    {
	try
	{
	    // invoke on the supportsDifferentTableCorrelationNames
	    logMsg("Calling supportsDifferentTableCorrelationNames on DatabaseMetaData");
	    boolean retValue = dbmd.supportsDifferentTableCorrelationNames();
	    if (retValue)
	    {
		logMsg("supportsDifferentTableCorrelationNames method is supported");
	    }
	    else
	    {
		logMsg("supportsDifferentTableCorrelationNames method is not supported");
	    }
	}
	catch (SQLException sqle)
	{
	    logErr("SQL exception " + sqle.getMessage());
	    throw new Exception(
		    "Call to supportsDifferentTableCorrelationNames is Failed!",
		    sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected exception " + e.getMessage());
	    throw new Exception(
		    "Call to supportsDifferentTableCorrelationNames is Failed!",
		    e);
	}
    }

    /*
     * @testName: testSupportsExpressionsInOrderBy
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The
     * supportsExpressionsInOrderBy() method must return a boolean value; true
     * if the database supports expressions in ORDER BY lists and false
     * otherwise. (See JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get the DataBaseMetaData object from the Connection to
     * the DataBase and call the supportsExpressionsInOrderBy() method on that
     * object. It should return a boolean value; either true or false.
     */
    @Test
    public void testSupportsExpressionsInOrderBy() throws Exception
    {
	try
	{
	    // invoke on the supportsExpressionsInOrderBy
	    logMsg("Calling supportsExpressionsInOrderBy on DatabaseMetaData");
	    boolean retValue = dbmd.supportsExpressionsInOrderBy();
	    if (retValue)
	    {
		logMsg("supportsExpressionsInOrderBy method is supported");
	    }
	    else
	    {
		logMsg("supportsExpressionsInOrderBy method is not supported");
	    }
	}
	catch (SQLException sqle)
	{
	    logErr("SQL exception " + sqle.getMessage());
	    throw new Exception(
		    "Call to supportsExpressionsInOrderBy is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected exception " + e.getMessage());
	    throw new Exception(
		    "Call to supportsExpressionsInOrderBy is Failed!", e);
	}
    }

    /*
     * @testName: testSupportsOrderByUnrelated
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The
     * supportsOrderByUnrelated() method must return a boolean value; true if
     * the database supports ORDER BY clause can use columns that are not in the
     * SELECT clause and false otherwise. (See JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get the DataBaseMetaData object from the Connection to
     * the DataBase and call the supportsOrderByUnrelated() method on that
     * object. It should return a boolean value; either true or false.
     */
    @Test
    public void testSupportsOrderByUnrelated() throws Exception
    {
	try
	{
	    // invoke on the supportsOrderByUnrelated
	    logMsg("Calling supportsOrderByUnrelated on DatabaseMetaData");
	    boolean retValue = dbmd.supportsOrderByUnrelated();
	    if (retValue)
	    {
		logMsg("supportsOrderByUnrelated method is supported");
	    }
	    else
	    {
		logMsg("supportsOrderByUnrelated method is not supported");
	    }
	}
	catch (SQLException sqle)
	{
	    logErr("SQL exception " + sqle.getMessage());
	    throw new Exception("Call to supportsOrderByUnrelated is Failed!",
		    sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected exception " + e.getMessage());
	    throw new Exception("Call to supportsOrderByUnrelated is Failed!",
		    e);
	}
    }

    /*
     * @testName: testSupportsGroupBy
     * 
     * @assertion: The DatabaseMetaData provides information about the database.
     * (See section 15.1 of JDBC 2.0 API Reference & Tutorial 2nd edition)
     * 
     * A driver must provide full support for DatabaseMetaData and
     * ResultSetMetaData. This implies that all of the methods in the
     * DatabaseMetaData interface must be implemented and must behave as
     * specified in the JDBC 1.0 and 2.0 specifications. None of the methods in
     * DatabaseMetaData and ResultSetMetaData may throw an exception because
     * they are not implemented. (See section 6.2.2.3 of Java2 Platform
     * Enterprise Edition (J2EE) Specification v1.2) The supportsGroupBy()
     * method must return a boolean value; true if the database supports GROUP
     * BY clause and false otherwise. (See JDK 1.2.2 API documentation)
     * 
     * @test_Strategy: Get the DataBaseMetaData object from the Connection to
     * the DataBase and call the supportsGroupBy() method on that object. It
     * should return a boolean value; either true or false.
     */
    @Test
    public void testSupportsGroupBy() throws Exception
    {
	try
	{
	    // invoke on the supportsGroupBy
	    logMsg("Calling supportsGroupBy on DatabaseMetaData");
	    boolean retValue = dbmd.supportsGroupBy();
	    if (retValue)
	    {
		logMsg("supportsGroupBy method is supported");
	    }
	    else
	    {
		logMsg("supportsGroupBy method is not supported");
	    }
	}
	catch (SQLException sqle)
	{
	    logErr("SQL exception " + sqle.getMessage());
	    throw new Exception("Call to supportsGroupBy is Failed!", sqle);
	}
	catch (Exception e)
	{
	    logErr("Unexpected exception " + e.getMessage());
	    throw new Exception("Call to supportsGroupBy is Failed!", e);
	}
    }

    /* cleanup */
    @AfterClass
    public static void cleanup() throws Exception
    {
	try
	{
	    // Close the database
	    // dbSch.destroyData(conn);
	    dbSch.dbUnConnect(conn);
	    logMsg("Cleanup ok;");
	}
	catch (Exception e)
	{
	    logErr("An error occurred while closing the database connection");
	}
    }
}
